Apparatus and method for interfacing hardware events with software events

ABSTRACT

An apparatus for associating a hardware event with a software component event. The system includes a hardware interrupt signal input. It also includes a first-in-first-out data structure coupled with the hardware interrupt signal input. Further included is a dispatch thread component coupled with the first-in-first-out data structure. The dispatch thread component can output a software event.

CROSS REFERENCE TO RELATED APPLICATIONS AND INCORPORATION BY REFERENCE

This application is a continuation of U.S. application Ser. No.10/093,952, filed Mar. 7, 2002, said application Ser. No. 10/093,952 inturn claims the benefit of U.S. Provisional Application No. 60/273,858,filed Mar. 7, 2001. The entire specification of U.S. ProvisionalApplication No. 60/273,858, filed Mar. 7, 2001, including all text anddrawing figures is hereby incorporated herein by this reference. Also,the entire specification of U.S. application Ser. No. 10/093,952, filedMar. 7, 2002, including all text and drawing figures is herebyincorporated herein by this reference.

BACKGROUND OF THE INVENTION

Object-oriented computing languages have been developed and successfullyused to develop a wide variety of software applications. One advantageof the object-oriented languages is the increased programming efficiencygained from the ability to reuse and/or modify prior-written code. C++is one example of a well-known object-oriented computing language.

Platform-independent computing languages have been created that, withthe aid of an appropriate virtual machine, permit the same applicationcode to be run in conjunction with a variety of different operatingsystems. Such languages promote efficiency by eliminating the need todevelop a separate version of an application for each type of operatingsystem expected to be encountered. JAVA is an example of aplatform-independent computing language. JAVA is also an example of anobject-oriented language.

Component-based software architectures provide a system that can enhancethe reusability advantage gained from object-oriented languages.Component-based software architectures achieve these gains byfacilitating the connecting of two or more separate software componentsto form a new application. JavaBeans is an example of a component-basedsoftware architecture. Other types of component-based softwarearchitectures include, for example, Microsoft's COM, IBM's OpenDoc andNetscape's LiveConnect.

In the JavaBean architecture, software components (“beans”) communicatevia “events.” A “source” or “event-generating” component fires an eventto a “target” or “listener” component. An intermediary object, oftenreferred to as an “adapter,” facilitates the transaction. The adaptercan be created by a builder tool at design time using a process known asintrospection.

The JavaBean component model is well suited for graphical andnon-graphical software components for general-purpose computing systems.The JavaBean component model is not suitable, however, for embedded,time-critical or real time systems. Although JavaBean properties may beacceptable for such systems, JavaBean events are not. Accordingly, anevent interface for an object-oriented component-based softwarearchitecture is needed that is suitable for an embedded, time-criticalor real-time system. Further, a technique for multicasting events isneeded.

Additionally, recent advances (for example, the JAVA 2 Platform, MicroEdition and the Real-Time Specification for JAVA) have facilitatedsimilar efficiency gains to be achieved with real-time and embeddedhardware driver components. Now, what is further needed is an apparatusfor associating a hardware interrupt event with a software componentevent. Currently existing systems, such as C++, JavaBeans, andMicrosoft's COM for example, do not meet the “timely delivery” andmemory consumption requirements of time-sensitive and embeddedapplications.

SUMMARY OF THE INVENTION

The present invention involves in part a system for interfacing ahardware interrupt-generating component with a software event handlingsystem. Further, the specification discloses a software component modelfacilitating time-critical, real time or embedded applications. Alsodisclosed is a unique multicasting scheme that can notify one or morelistener components of an event. It will be appreciated that the variousinventions disclosed can be used independently of each other or incombination.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 depicts a component model suitable for use in a time sensitiveapplication.

FIG. 2 depicts a transmission environment involving an event-generatingsoftware component, a single listener software component and a pluralityof unused event multicaster objects.

FIG. 3 depicts a multicast transmission environment involving anevent-generating software component, an event multicaster object and twolistener software components.

FIG. 4 depicts a multicast transmission environment involving anevent-generating software component, two event multicaster objects andthree listener software components.

FIG. 5 depicts a multicast transmission environment involving anevent-generating software component, a plurality of event multicasterobjects and a plurality of listener software components.

FIG. 6 depicts an architecture interfacing a hardware device and clientsoftware, the architecture including a hardware driver, an interruptcontroller component and a hardware event object.

DETAILED DESCRIPTION

FIG. 1 depicts a component model suitable for use in a time sensitiveapplication. In FIG. 1, an “event-generating software component” 100 cancommunicate with another software component, here referred to as a“listener software component” 102, via an “event transmission object”104. The model described in relation to FIG. 1 and as further describedthroughout this specification provides a consistent interface betweenbuilding blocks for, for example, real-time embedded applications.

The event-generating software component 100 and the listener softwarecomponent 102 can be software objects having properties that can beconfigured and accessed via setter and getter methods. Suchconfiguration can be accomplished, for example, at design time via useof a development tool. The model also specifies events that can be sentfrom the event-generating software component 100 to the listenersoftware component 102.

When an event of interest occurs, it is packaged into an eventtransmission object 104 for delivery to one or more listener softwarecomponents. A multicast communications system that can be used tocommunicate events is described in greater detail below. The developmenttool can examine the event-generating software component 100 and thelistener software component 102 and create the appropriate eventtransmission object 104 to facilitate the communication.

The JavaBean Component Architecture provides an architecture suitablefor use with the present invention. The JavaBean Component Architectureprovides a means to reuse software, which when combined with toolsupport, results in an increase in developer productivity. Further,recent advances in the Java 2 Platform, Micro Edition (J2ME) and therelease of the Real-Time Specification for JAVA (RTSJ) enableachievement of productivity gains with real-time and embedded hardwaredevice components.

The JavaBean Component Architecture has been used successfully forgraphical applications using AWT and Swing components and has been usedby third party software vendors to distribute reusable softwarecomponents using standard packaging. The JavaBean model specifiesproperties that can configure the characteristics of the JavaBean frominside a development environment at design time. It also specifiesevents that are sent from the JavaBean to the application when an eventof interest occurs. Further, the JavaBean component specification alsoincludes support for “BeanInfo” files, and many development toolsprovide property editors to configure JavaBeans appropriately for theapplication under development. The JavaBean component model is wellsuited for graphical and non-graphical components for general-purposecomputing systems. The JavaBeans event model, however, is not wellsuited for time-critical or embedded systems.

JavaBean properties are “get” and “set” methods that are used toconfigure the behavior of the component, both at design time by adevelopment tool and at runtime by an application. The extra overheadassociated with calling the “get” and “set” methods, however, is minimalcompared to the benefits gained. Additionally, such method call overheadis predictable. Consequently, JavaBean properties are acceptable forembedded and real-time applications without modification.

Unmodified JavaBean events, however, are not appropriate for embeddedand time-sensitive applications. JavaBean events include a listenerinterface that includes one or more methods that will be called when anevent notification is sent to a listener. An application implements theinterface and registers it with the JavaBean, which calls the eventmethods at the appropriate time. Each of these event methods must alsoinclude a parameter of type EventObject. When a component sends anevent, it will create a descendent of EventObject, initialize it, andpass it as a parameter to each registered event listener.

Normally, since an event handler could keep a reference to theEventObject for future use, a JavaBean will create a new EventObjecteach time an event is sent. If the JavaBean reused the same EventObject,the internal state could be changed without the event listener expectingit. Since the creation and discarding of EventObjects is a veryexpensive operation (the “new( )” operation for the EventObject beingtime consuming and unpredictable), such an event transmission techniqueis not appropriate for embedded or time-critical applications.Furthermore, a garbage collection cycle can consequently be initiated ata very undesirable time.

One solution to the above-described problem (the creation of a newEventObject each time an event is sent) is to create one EventObject andreuse it as needed. This solution avoids the overhead associated withthe “new( )” operation and it also avoids the possible inopportuneinitiation of a garbage collection cycle. Such a solution does not,however, strictly adhere to the JavaBean specification. This solutionwould also allow the development tools to recognize the events andprovide full tool support. Overhead does result to some extent, however,since the fields in the EventObject must be initialized with customstate information and the event handler has to access these fields toget the state information.

A second solution is to bypass the use of an EventObject and to insteadpass data directly to the event handlers as primitive data types. Thistype of event can be described as a cracked event or a primitive event.This second solution delivers the maximum speed advantage. Further, somecurrently available development tools (for example, the Jbuilder tool byBorland) already provide support for cracked or primitive events thatconform to the JavaBeans naming convention. Additional development toolsmay also support such events as the RTSJ becomes more accepted andwidespread.

In one embodiment, the cracked events of the second-described solutioncan be unique for each software component and for each type of eventthat is sent. These “unique” events have the advantage of being moreappropriately named, since each event can be descriptive and specific toone type of event. In another embodiment, the cracked events can be madeto be generic and can be reused for more than one software component andfor more than one event in the same software component. These “generic”events require fewer class definitions than do the unique events andthey are independent of any one component. This reduces the number ofinner classes required to interface the software components and alsoreduces call overhead. Software components utilizing the generic-styleof events can often be wired directly together in a pipeline fashionwith little or no “glue code” required.

Various types of cracked events can be used to implement the secondsolution described above. One such event can be an event having noparameters. The TriggerEvent of the aJile Real-Time Embedded Componentmodel (aRTEC) provides an example of a cracked event having noparameters. The aRTEC model is a newly available product of the assigneeof the present application. Such an event can be sent by anevent-generating software component 100 as an indicator that somephysical condition has occurred. For example, it can be used to indicatea timeout or to indicate that a sensor-related threshold has beencrossed. It can also be received to control some type of physicalcondition (for example, to set, reset or stop a timer or to activate ordeactivate some other component controlling a physical event such aslight or sound generation, etc.).

Another type of suitable cracked event is an event that passes a Booleanparameter. The AssertEvent of the above-noted aRTEC model is an exampleof an event having a single Boolean parameter. Such an event can be sentto indicate a state change. For example, a True value in the parametercan indicate that a given state is active while a False value canindicate that the given state is inactive. (Of course, if desired, Truecan indicate an inactive state while False is used to indicate an activestate.) This type of event can also be sent to control a physicalcondition. A listener software component 102 receiving the appropriateBoolean event via an event transmission object 104 can proceed tocontrol a physical condition in response to the event. For example, alamp component could receive a Boolean event, such as the aRTECAssertEvent that will cause it to turn a lamp on when, for example, aTrue value is passed and to turn the lamp off when a False value ispassed.

A third type of cracked event that can be used to implement the secondsolution is an event passing a numeric value. The DataEvent of the aRTECmodel provides an example of an event having a single integer for itsparameter. Such an event can be used when a numeric value is associatedwith an event. It can be used to indicate or control the degree ofchange in a physical condition. For example, a light level, sound level,position change, temperature change, rotation change, etc., etc., can beindicated by passing a numeric value as the parameter. By way of a morespecific example, a rotation sensor can use such an event, a DataEventfor example, when it detects a rotation of a hardware component. Therotation can be communicated, for example, by passing a value indicatingthe angle of rotation detected.

It will be appreciated that other types of cracked events can also beused. For example, events having a parameter of type Double, Long,Float, or String can be used. Further, an event characterized as passinga DoubleLong numeric value can be used. Such an event has twoparameters, one passing a value of type Double and the other passing avalue of type Long. The aRTEC versions of these events are labeledrespectively as DoubleEvent, LongEvent, FloatEvent, StringEvent andDoubleLongEvent. The aRTEC model is an extension of the JavaBeanComponent Architecture. The aRTEC setter and getter methods use theJavaBean naming convention. Further, the aRTEC framework implements adirect extension of java.util.DataEventListener.

Additional detail and description related to specific aRTEC crackedevents will now be presented.

The following describes the aRTEC AssertEventListener interface (publicinterface AssertEventListener): Interface AssertEventListener is anevent listener for changes from a mode, state, or object that can becomeasserted or de-asserted. Method Summary: void assertEvent (booleanactive). Informs observers of a mode change, state change, or any otherchange that can be considered as an object or physical abstractionchanging from an asserted state to a non-asserted state or vice-versa.Method Detail: public void assertEvent (Boolean active). Informsobservers of a mode change, state change, or any other change that canbe considered as an object or physical abstraction changing from anasserted state to a non-asserted state or vice-versa. Parameters: activewhether the mode is asserted or non-asserted The following describes theaRTEC DataEventListener interface (public interface DataEventListener):Interface DataEventListener is an event listener for a fundamental intvalue. Used as an event listener when a dedicated event set is notwarranted. Method Summary: void dataEvent (int value). Informs observersof a state change that can be described as an int value. Method Detail:public void dataEvent (int value). Informs observers of a state changethat can be described as an int value. Parameters: value—the new datawhen a change occurs.

The following describes the aRTEC DoubleEventListener interface (publicinterface DoubleEventListener): Interface DoubleEventListener is anevent listener for a fundamental double value. Used as an event listenerwhen a dedicated event set is not warranted. Method Summary: voiddoubleEvent (double Value). Informs observers of a state change that canbe described as a double value. Method Detail: public void doubleEvent(double Value). Informs observers of a state change that can bedescribed as a double value. Parameters: Value—the new data when achange occurs.

The following describes the aRTEC DoubleLongEventListener interface(public interface DoubleLongEventListener): InterfaceDoubleLongEventListener is an event listener for a compound double andlong value. Used as an event listener when a dedicated event set is notwarranted. Method Summary: void doubleLongEvent (double doubleValue,long longvalue). Informs observers of a state change that can bedescribed as a combined double and long value. Method Detail: publicvoid doubleLongEvent (double doubleValue, long longvalue). Informsobservers of a state change that can be described as a combined doubleand long value. Parameters: doubleValue—the new data when a changeoccurs, longvalue—a long value associated with the double value.

The following describes the aRTEC FloatEventListener interface (publicinterface FloatEventListener): Interface FloatEventListener is an eventlistener for a fundamental float value. Used as an event listener when adedicated event set is not warranted. Method Summary: void floatEvent(float value). Informs observers of a state change that can be describedas a float value. Method Detail: public void floatEvent (float value).Informs observers of a state change that can be described as a floatvalue. Parameters: value—the new data when a change occurs.

The following describes the aRTEC LongEventListener interface (publicinterface LongEventListener): Interface LongEventListener is an eventlistener for a fundamental long value. Used as an event listener when adedicated event set is not warranted. Method Summary: void longEvent(long value). Informs observers of a state change that can be describedas a long value. Method Detail: public void longEvent (long value).Informs observers of a state change that can be described as a longvalue. Parameters: value—the new data when a change occurs.

The following describes the aRTEC StringEventListener interface (publicinterface StringEventListener): Interface StringEventListener is anevent listener for a String value. Used as an event listener when adedicated event set is not warranted. Method Summary: void stringEvent(java.lang.String value). Informs observers of new data that can bedescribed as a String. Method Detail: public void stringEvent(java.lang.String value). Informs observers of new data that can bedescribed as a String. Parameters: value—the new data.

The following describes the aRTEC TriggerEventListener interface (publicinterface TriggerEventListener): Interface TriggerEventListener is anevent listener for an action without associated data. Used as an eventlistener when a dedicated event set is not warranted. Method Summary:void triggerEvent ( ). Informs observers of an action that can bedescribed without data. Method Detail: public void triggerEvent( ).Informs observers of an action that can be described without data.

The following information provides further detail and description of thevarious aRTEC specific components that can generate and receive thecracked events.

The following describes the aRTEC AssertToTrigger component (publicclass AssertToTrigger; extends java.lang.Object; implementsAssertEventListener), a component that converts an AssertEvent to one oftwo trigger events. One trigger event is fired for AssertEvents (true)and another is fired for AssertEvent (false).

Constructor Summary Related to AssertToTrigger Class: AssertToTrigger ().

Method Summary Related to AssertToTrigger Class:

void addNegativeListener (TriggerEventListener listener)—registers aTriggerEventListener to be notified when an assert with a negative valueis received.

void addPositiveListener (TriggerEventListener listener)—registers aTriggerEventListener to be notified when an assert with a positive valueis received.

void assertEvent (boolean value)—assert input event.

void removeNegativeListener (TriggerEventListener listener)—unregistersa triggerEventListener so it will no longer receive an event when anegative assert is received.

void removePositiveListener (TriggerEventListener listener)—unregistersa triggerEventListener so it will no longer receive an event when apositive assert is received.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Constructor Detail Related to AssertToTrigger Class: publicAssertToTrigger ( ).

Method Detail Related to AssertToTrigger Class for assertEvent: publicvoid assertEvent (boolean value). Specified by: assertEvent in interfaceAssertEventListener. Parameters: active—indicates whether the mode isasserted or non-asserted.

Method Detail Related to AssertToTrigger Class for addPositiveListener:public void addPositiveListener (TriggerEventListener listener).Registers a TriggerEventListener to be notified when an assert with apositive value is received. Parameters: listener—the receiver of thetriggerEvent.

Method Detail Related to AssertToTrigger Class forremovePositiveListener: public void removePositiveListener(TriggerEventListener listener). Unregisters a triggerEventListener soit will no longer receive an event when a positive assert is received.Parameters: listener—the listener that will no longer receive events.

Method Detail Related to AssertToTrigger Class for addNegativeListener:public void addNegativeListener (TriggerEventListener listener).Registers a TriggerEventListener to be notified when an assert with anegative value is received. Parameters: listener—the receiver of thetriggerEvent.

Method Detail Related to AssertToTrigger Class forremoveNegativeListener: public void removeNegativeListener(TriggerEventListener listener). Unregisters a triggerEventListener soit will no longer receive an event when a negative assert is received.Parameters: listener—the listener that will no longer receive events.

The following describes the aRTEC CallbackTimer component (public classCallbackTimer; extends java.lang.Object; implements java.lang.Runnable).

Constructor Summary Related to CallbackTimer Class: CallbackTimer ()—creates and starts a new callback timer with a default thread priorityof one greater than the calling thread.

Method Summary Related to CallbackTimer Class:

void callback (long timeMillis, TriggerEventListener listener)—registersa method to be called back at a specific time.

static CallbackTimer getlnstance ( )—returns a common callback timerthat can be shared between users.

int getThreadPriority ( )—returns the priority of the thread that thiscallback timer is using.

boolean removeAndCallback (long timeMillis, TriggerEventListenerlistener)—registers a listener for a callback at a specific time andremoves any pending callbacks in the queue.

boolean removeCallback (TriggerEventListener listener)—removes allentries for a given listener.

void run ( )—internal use only.

void setThreadPriority (int value)—sets the priority of the thread thatsends events from this callback timer.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Constructor Detail Related to CallbackTimer Class: public CallbackTimer( ). Creates and starts a new callback timer with a default threadpriority of one greater than the calling thread. A system callback timercan be created and reused by calling getlnstance ( ) instead of creatinga dedicated callback timer using this method.

Method Detail Related to CallbackTimer Class for getThreadPriority:public int getThreadPriority ( ). Return the priority of the thread thatthis callback timer is using. Returns: the thread priority of thiscallback timer.

Method Detail Related to CallbackTimer Class for setThreadPriority:public void setThreadPriority (int value). Sets the priority of thethread that sends events from this callback timer. Parameters: value—thenew thread priority level.

Method Detail Related to CallbackTimer Class for getlnstance: publicstatic CallbackTimer getlnstance ( ). Returns a common callback timerthat can be shared between users.

Method Detail Related to CallbackTimer Class for callback: public voidcallback (long timeMillis, TriggerEventListener listener). Registers amethod to be called back at a specific time. A TriggerEvent will be sentto the specified listener at the specified time. If the same listener isalready registered to receive a callback from this class, both callbackswill be honored. Parameters: timeMillis—the absolute time the callbackwill occur, listener—the object to receive a trigger event.

Method Detail Related to CallbackTimer Class for removeCallback: publicboolean removeCallback (TriggerEventListener listener). Removes allentries for a given listener. This listener will not receive anycallbacks already in the queue. Return true if at least one queuedcallback entry was removed.

Method Detail Related to CallbackTimer Class for removeAndCallback:public boolean removeAndCallback (long timeMillis, TriggerEventListenerlistener). Registers a listener for a callback at a specific time andremoves any pending callbacks in the queue. This first removes any queueentries with the same listener, then registers it for a new callback atthe specified absolute time. Parameters: timeMillis—the absolute timethe callback will occur, listener—the object to receive a trigger event.Returns: true if at least one queued callback entry was removed.

Method Detail Related to CallbackTimer Class for run: public void run (). Internal use only. This class implements the runnable interface andhas a dedicated thread. Specified by: run in interfacejava.lang.Runnable.

The following describes the aRTEC Counter component (public classCounter; extends java.lang.Object; implements TriggerEventListener,AssertEventListener, DataEventListener), a component that provides aninteger up/down counter. This class is a counter that will count up ordown to a specified rollover value. It then rolls back and continuescounting, or stops counting based on the Reload property. The class willsend trigger events when a reload condition occurs, and send data eventswhen the count changes.

The counter can count up or down dependent on the countUp property. Whencounting up, counting will continue until the reload value −1 isreached. On the next count, a trigger event is thrown and the counterreloads to 0. If the counter is configured to not reload, the timer willnot be reset back to 0, but the trigger event will still be sent. Thetrigger event is latched internally so it will only be sent once, untilthe count does change.

When counting down, counting will continue until 0 is reached. On thenext count, a trigger event is thrown, and the counter reloads to 1minus the reload value. If the counter is configured to no reload, thecount will stay at 0, but the trigger event will still be sent. Thetrigger event is latched internally so it will only be sent once, untilthe count does change.

This class can receive a trigger event. This will cause the counter tobe incremented or decremented based on the countUp property. Further,this class can receive an assert event that will enable or disable thecounter. If the received boolean value is true, the counter will beenabled. If it is false, the counter will be disabled. This class canalso receive a date event that will force the count to a specific value.

Constructor Summary Related to the Counter Class: Counter ( ).

Method Summary Related to the Counter Class:

void addCountListener (DataEventListener listener)—registers aDataEventListener to receive an event containing the new count data whenthe count changes.

void addRolloverListener (TriggerEventListener listener)—registers aTriggerEventListener to receive a stateless event when the timeroverflows.

void assertEvent (boolean value)—receives an assertEvent that willenable or disable the counter.

void count ( )—causes the counter to count if it is enabled.

void dataEvent (int value)—receives a dataEvent that will set thecurrent count.

int getcount ( )—return the current count.

int getReloadCount ( )—returns the reload value of the counter.

TriggerEventListener getResetListener ( )—returns a triggerEventListenerthat will cause the counter to reset to 0 if counting up and toreloadValue−1 if counting down.

boolean isCountup ( )—returns if the counter is counting up or down.

boolean isEnabled ( )—returns the enabled state of the counter.

boolean isReload ( )—returns the reload property of the counter.

void removeCountListener (DataEventListener listener)—unregisters aDataEventListener so it will no longer receive an event when the countchanges

void removeRolloverListener (TriggerEventListener listener)—unregistersa triggerEventListener so it will no longer receive an event onrollover.

void reset ( )—resets the counter value.

void setCount (int value)—sets the current count.

void setCountUp (boolean value)—sets if the counter is counting up ordown.

void setEnabled (boolean value)—sets the enabled state of the counter.

void setReload (boolean value)—sets if the counter will reload after thecount reaches 0 if counting down or reload−1 if counting up.

void setReloadCount (int value)—sets the reload value of the counter.

void triggerEvent ( )—receives a triggerEvent that will cause thecounter to increment or decrement if enabled.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Constructor Detail Related to the Counter Class: public Counter ( ).

Method Detail Related to the Counter Class for isEnabled: public booleanisEnabled ( ). Returns the enabled state of the counter. When thecounter is not enabled, input triggerEvents are ignored.

Method Detail Related to the Counter Class for setEnabled: public voidsetEnabled (boolean value). Sets the enabled state of the counter. Whenthe counter is not enabled, triggerEvents are ignored.

Method Detail Related to the Counter Class for isCountUp: public booleanisCountUp ( ). Returns if the counter is counting up or down.

Method Detail Related to the Counter Class for setCountUp: public voidsetCountUp (boolean value). Sets if the counter is counting up or down

Method Detail Related to the Counter Class for isReload: public booleanisReload ( ). Returns the reload property of the counter. When reload istrue, the counter will reset back to 1−reloadValue, or 0 depending onwhether the counter is counting up or down. If the reload is false, thetimer will stop at 0 when counting down or at reload−1 value whencounting up.

Method Detail Related to the Counter Class for setReload: public voidsetReload (boolean value). Sets if the counter will reload after thecount reaches 0 if counting down or reload−1 if counting up.

Method Detail Related to the Counter Class for getReloadCount: publicint getReloadCount ( ). Returns the reload value of the counter. Thecounter will count up to 1−the reload count, or down to 0 and reloadwith 1−the reload value.

Method Detail Related to the Counter Class for setReloadCount: publicvoid setReloadCount (int value). Sets the reload value of the counter.The counter will count up to the reload count−1, or down to 0 and reloadwith 1−the reload value.

Method Detail Related-to the Counter Class for getCount: public intgetcount ( ). Return the current count.

Method Detail Related to the Counter Class for setCount: public voidsetCount (int value). Sets the current count.

Method Detail Related to the Counter Class for count: public void count( ). Causes the counter to count if it is enabled. The counter willcount up or down based on the countUp property.

Method Detail Related to the Counter Class for reset: public void reset( ). Resets the counter value. The count value will be set to 0 if it iscounting up, or the reload value minus 1 if counting down.

Method Detail Related to the Counter Class for addRolloverListener:public void addRolloverListener (TriggerEventListener listener).Registers a TriggerEventListener to receive a stateless event when thetimer overflows. If counting up, the event will be sent when the counterrolls back to zero. If counting down, the event will be sent when thecounter reloads with the reload value. Parameters: listener—the receiverof the triggerEvent.

Method Detail Related to the Counter Class for removeRolloverListener:public void removeRolloverListener (TriggerEventListener listener).Unregisters a triggerEventListener so it will no longer receive an eventon rollover. Parameters: listener—the listener that will no longerreceive events.

Method Detail Related to the Counter Class for addCountListener: publicvoid addCountListener (DataEventListener listener). Registers aDataEventListener to receive an event containing the new count data whenthe count changes. Parameters: listener—the receiver of the dataEvent.

Method Detail Related to the Counter Class for removeCountListener:public void removeCountListener (DataEventListener listener).Unregisters a DataEventListener so it will no longer receive an eventwhen the count changes. Parameters: listener—the listener that will nolonger receive events.

Method Detail Related to the Counter Class for assertEvent: public voidassertEvent (boolean value). Receives an assertEvent that will enable ordisable the counter. Specified by: assertEvent in interfaceAssertEventListener. Parameters: active—whether the mode is asserted ornon-asserted.

Method Detail Related to the Counter Class for triggerEvent: public voidtriggerEvent ( ). Receives a triggerEvent that will cause the counter toincrement or decrement if enabled. Specified by: triggerEvent ininterface TriggerEventListener.

Method Detail Related to the Counter Class for dataEvent: public voiddataEvent (int value). Receives a dataEvent that will set the currentcount. This is functionally identical to calling the setCount Method.Specified by: dataEvent in interface DataEventListener. Parameters:value—the count that will be loaded.

Method Detail Related to the Counter Class for getResetListener: publicTriggerEventListener getResetListener ( ). Returns atriggerEventListener that will cause the counter to reset to 0 ifcounting up and to reloadValue−1 if counting down.

The following describes the aRTEC DataLookup component (public classDataLookup; extends java.lang.Object; implements DataEventListener), acomponent that converts a data event to another data event. The receiveddata event is used as an index into a table of constants to determinethe sent value. If the input value is not in range, an output data eventis not sent.

Constructor Summary Related to the DataLookup Class: DataLookup ( ).

Method Summary Related to the DataLookup Class:

void addDataListener (DataEventListener listener)—registers aDataEventListener to be notified when a data event is received.

void dataEvent (int value)—looks up data in the table based on thepassed index.

int [] getLookupTable ( )—returns the data lookup table.

void removeDataListener (DataEventListener listener)—unregisters anDataEventListener so it will no longer receive events.

void setLookupTable (int []table)—sets the data lookup table.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Constructor Detail Related to the DataLookup Class: public DataLookup ().

Method Detail Related to the DataLookup Class for getLookupTable: publicint [] getLookupTable ( ). Returns the data lookup table.

Method Detail Related to the DataLookup Class for setLookupTable: publicvoid setLookupTable (int [] table). Sets the data lookup table.

Method Detail Related to the DataLookup Class for dataEvent: public voiddataEvent (int value). Looks up data in the table based on the passedindex. The result is resent in another data event. Specified by:dataEvent in interface DataEventListener. Parameters: value—the new datawhen a change occurs.

Method Detail Related to the DataLookup Class for addDataListener:public void addDataListener (DataEventListener listener). Registers anDataEventListener to be notified when a data event is received. The dataparameter will date from the data table. Parameters: listener—thereceiver of the DataEvent.

Method Detail Related to the DataLookup Class for removeDataListener:public void removeDataListener (DataEventListener listener). Unregistersa DataEventListener so it will no longer receive events. Parameters:listener—identifies the listener that will no longer receive events.

The following describes the aRTEC OneShotTimer component (public classOneShotTimer; extends java.lang.Object: implementsTriggerEventListener), a one shot timer component that sends eventsafter a preset time period. The component can be started and stopped bymethods or by receiving events. When the preset time interval expires, atrigger event is sent to indicate that the time has elapsed and thetimer waits to be started again. If the timer has been started but hasnot yet expired, it is considered to be running. If the timer isrestarted while it is running, the timer starts over, effectivelyextending the time delay.

When the one shot is started, it sends an assertEvent with true as thevalue to indicate that it is running. When the time expires, it sends anassertEvent with false as the parameter to indicate that the timer is nolonger running. At that time, a triggerEvent is also sent.

The one shot timer can receive one triggerEvent to start the timer andone triggerEvent to stop the timer. A trigger event sent to this objectwill start the timer. Because this class can only implement thetriggerEventListener once, an inner class is used to provide atriggerEventListener listener that will stop the timer when a triggerevent is received.

Constructor Summary Related to the OneShotTimer Class: OneShotTimer ( ).Creates a lightweight one shot timer component.

Method Summary Related to the OneShotTimer Class:

void addRunningListener (AssertEventListener listener)—registers anAssertEventListener to be notified true when the one shot starts andnotified false when the one shot completes.

void addTimerListener (TriggerEventListener listener)—registers aTriggerEventListener to receive a stateless event when the one shot timeexpires.

int getIntervalMillis ( )—returns the time interval of the timer inmilliseconds.

TriggerEventListener getStopListener ( )—returns a TriggerEventListenerthat will stop the one shot.

void removeRunningListener (AssertEventListener listener)—unregisters anAssertEventListener so it will no longer receive events.

void removeTimerListener (TriggerEventListener listener)—unregisters atriggerEventListener so it will no longer receive an event on timeout.

void setIntervalMillis (int value)—sets the time interval of the timerin milliseconds.

void start ( )—starts the one shot timer.

void stop ( )—stops the timer.

void triggerEvent ( )—receives a trigger event that will start thetimer.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Constructor Detail Related to the OneShotTimer Class: publicOneShotTimer ( ). Creates a lightweight one shot timer component.

Method Detail Related to the OneShotTimer Class for getIntervaIMillis:public int getIntervaIMillis ( ). Returns the time interval of the timerin milliseconds. The time interval can be extended by restarting thetimer by calling the start method or sending it a triggerEvent. Returns:the time that the one shot will run in milliseconds.

Method Detail Related to the OneShotTimer Class for setIntervalMillis:public void setIntervaIMillis (int value). Sets the time interval of thetimer in milliseconds. The time interval can be extended by restartingthe timer by calling the start method or sending it a triggerEvent. Ifthe timer is currently running, it will not be affected until it isrestarted. Parameters: value—the time that the one shot will run inmilliseconds.

Method Detail Related to the OneShotTimer Class for start: public voidstart ( ). Starts the one shot timer. If the timer is already running,then the time interval is extended so it will expire at the currenttime+the interval time.

Method Detail Related to the OneShotTimer Class for stop: public voidstop ( ). Stops the timer. In order to start it again, the timer must bereset by calling start.

Method Detail Related to the OneShotTimer Class for addTimerListener:public void addTimerListener (TriggerEventListener listener). Registersa TriggerEventListener to receive a stateless event when the one shottime expires. Parameters: listener—the receiver of the triggerEvent.

Method Detail Related to the OneShotTimer Class for removeTimerListener:public void removeTimerListener (TriggerEventListener listener).Unregisters a triggerEventListener so it will no longer receive an eventon timeout. Parameters: listener—the listener that will no longerreceive events.

Method Detail Related to the OneShotTimer Class for addRunningListener:public void addRunningListener (AssertEventListener listener). Registersan AssertEventListener to be notified true when the one shot starts andnotified false when the one shot completes. Parameters: listener—thereceiver of the assertEvent.

Method Detail Related to the OneShotTimer Class forremoveRunningListener: public void removeRunningListener(AssertEventListener listener). Unregisters an AssertEventListener so itwill no longer receive events. Parameters: listener—the listener thatwill no longer receive events.

Method Detail Related to the OneShotTimer Class for triggerEvent: publicvoid triggerEvent ( ). Receives a trigger event that will start thetimer. This method is functionally identical to start ( ). Specified by:triggerEvent in interface TriggerEventListener.

Method Detail Related to the OneShotTimer Class for getStopListener:public TriggerEventListener getStopListener ( ). Returns aTriggerEventListener that will stop the one shot. In order to start itagain, it must be restarted which will reset the time interval. TheOneShotTimer component can receive two unique trigger events to start orstop the timer. Because a triggerEventListener is an interface, thePeriodicTimer component can only directly receive one triggerEvent. Thisdefault trigger event will start the timer. An innerclass thatimplements the triggerEventListener interface is used to stop the timer.You can get a reference to this inner classes and register it as anevent listener. This method returns a reference to the inner class thatwill stop the timer. Returns: a reference to a triggerEventListener thatwill stop the timer.

The following describes the ARTEC PeriodicTimer component (public classPeriodicTimer; extends java.lang.Object; implements AssertEventListener,TriggerEventListener, java.lang.Runnable), a clock component thatgenerates a periodic stream of trigger events. This component can use astandard java thread, or a real-time periodic thread to generate eventsat a periodic rate. Its period and priority can be set. ATriggerEventListener can register to receive trigger events at aperiodic rate. The component can be disabled which will not stop thetimer but will prevent events from being thrown.

The periodic timer can receive an Assert event that will enable ordisable the timer. It can also receive trigger events to start or stopthe timer. A trigger event sent to this object will start the timer.Because this class can only implement the triggerEventListener once, aninner class is used to provide a triggerEventListener listener that willstop the PeriodicTimer when a trigger event is received. ConstructorSummary Related to the PeriodicTimer Class: PeriodicTimer ( ).

Method Summary Related to the PeriodicTimer Class:

void addPeriodicListener (TriggerEventListener listener)—registers aTriggerEventListener to receive a stateless event on a periodic basis.

void assertEvent (boolean value)—enables or disables the timer.

int getIntervalMillis ( )—returns the period in milliseconds.

TriggerEventListener getStopListener ( )—returns a TriggerEventListenerthat will stop the timer when an event is received.

int getThreadPriority ( )—sets the priority of the thread that generatestrigger events.

boolean isEnabled ( )—returns if the PeriodicTimer will throw events.

void removePeriodicListener (TriggerEventListener listener)—unregistersa triggerEventListener so it will no longer receive an event on aperiodic basis void run ( )—internal use only.

void setEnabled (boolean value)—enables or disables the PeriodicTimer tothrow events.

void setIntervalMillis (int value)—sets the period in milliseconds.

void setThreadPriority (int value)—returns the priority of the threadthat generates trigger events.

void start ( ) starts the periodic timer.

void stop ( )—stops the timer.

void triggerEvent ( )—starts the timer.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Constructor Detail Related to the PeriodicTimer Class: publicPeriodicTimer ( ).

Method Detail Related to the PeriodicTimer Class for getIntervalMillis:public int getIntervalMillis ( ). Returns the period in milliseconds.The period of this component can be configured. The period will beexact, meaning it will not slide based on event listeners processingtime. Returns: the current time between events in milliseconds.

Method Detail Related to the PeriodicTimer Class for setIntervalMillis:public void setIntervaIMillis (int value). Sets the period inmilliseconds. Note: the change may not be reflected until the old periodexpires. The period of this component can be configured. The period willbe exact, meaning it will not slide based on event listeners processingtime. Parameters: value—the new period in milliseconds.

Method Detail Related to the PeriodicTimer Class for getThreadPriority:public int getThreadPriority ( ). Sets the priority of the thread thatgenerates trigger events.

Method Detail Related to the PeriodicTimer Class for setThreadPriority:public void setThreadPriority (int value). Returns the priority of thethread that generates trigger events.

Method Detail Related to the PeriodicTimer Class for isEnabled: publicboolean isEnabled ( ). Returns if the PeriodicTimer will throw events.The PeriodicTimer can be enabled or disabled. This does not change ordelay the processing of events. The internal clock still runs, butevents will not be thrown.

Method Detail Related to the PeriodicTimer Class for setEnabled: publicvoid setEnabled (boolean value). Enables or disables the PeriodicTimerto throw events. The

PeriodicTimer can be enabled or disabled. This does not change or delaythe processing of events. The internal clock still runs, but events willnot be thrown.

Method Detail Related to the PeriodicTimer Class for start: public voidstart ( ). Starts the periodic timer. If the timer was previouslystopped, the next trigger time will be now+the period. If the timer hasalready been started, this method has no affect.

Method Detail Related to the PeriodicTimer Class for stop: public voidstop ( ). stops the timer. The time is stopped and no further eventswill be thrown until the timer has been started.

Method Detail Related to the PeriodicTimer Class for run: public voidrun ( ). Internal use only. This method is required to implement therunnable interface. Specified by: run in interface java.lang.Runnable.

Method Detail Related to the PeriodicTimer Class foraddPeriodicListener: public void addPeriodicListener(TriggerEventListener listener). Registers a TriggerEventListener toreceive a stateless event on a periodic basis. Parameters: listener—thereceiver of the AssertEvent.

Method Detail Related to the PeriodicTimer Class forremovePeriodicListener: public void removePeriodicListener(TriggerEventListener listener). Unregisters a triggerEventListener soit will no longer receive an event on a periodic basis. Parameters:listener—the listener that will no longer receive events.

Method Detail Related to the PeriodicTimer Class for assertEvent: publicvoid assertEvent (boolean value). Enables or disables the timer. Notethat the clock does not stop based on the enabled status, but triggerevents will not be thrown. Specified by: assertEvent in interfaceAssertEventListener. Parameters: active—whether the mode is asserted ornon-asserted.

Method Detail Related to the PeriodicTimer Class for triggerEvent:public void triggerEvent ( ). Starts the timer. This class can receivegeneric trigger events. Specified by: triggerEvent in interfaceTriggerEventListener.

Method Detail Related to the PeriodicTimer Class for getStopListener:public TriggerEventListener getStopListener ( ). Returns aTriggerEventListener that will stop the timer when an event is received.

The PeriodicTimer component can receive two unique trigger events tostart or stop the timer. Because a triggerEventListener is an interface,the PeriodicTimer component can only directly receive one triggerEvent.This default trigger event will start the timer. An innerclass thatimplement the triggerEventListener interface is used to stop the timer.You can get a reference to this inner class and register it as an eventlistener. This method returns a reference to the inner class that willstop the timer. Returns: a reference to a triggerEventListener that willstop the timer.

The following describes the ARTEC PushButton component (public classPushButton; extends java.lang.Object; implements TriggerEventListener),a component that controls and debounces a pushbutton switch wired to aGPIO pin. This class is similar in functionality to a GpioPin but itadditionally includes pin debouncing. A debounceTime is specified. Thepin must be in a stable state for this period of time before the changeis registered in this class.

Like the GpioPin class, this class can send a triggerEvent when thestate rises, falls, or both. Unlike the GpioPin, this class will send anassertEvent whenever the state changes with the state reflected in thepassed value. So the report policy will only affect the triggerEvent andnot the assertEvent in this class.

Field Summary Related to the PushButton Class:

static int TRIGGER OFF—causes the pushButton to no longer generate anytrigger events static int TRIGGER ON_PUSH—causes the pushButton to senda trigger event only when the button is pushed.

static int TRIGGER ON PUSH AND RELEASE—causes the pushbutton to send atrigger event when the button is pressed or when it is released.

static int TRIGGER ON RELEASE—causes the pushButton to send a triggerevent only when the button is released.

Constructor Summary Related to the PushButton Class:

PushButton ( )—creates an instance of a PushButton that has control overone GpioPin on an aJile Systems aJ-100 microcontroller. The pin IDproperty must be set at a later time before the PushButton can be used.

PushButton (int pinID)—creates an instance of an object that controlsone IO pin.

Method Summary Related to the PushButton Class:

void addStateListener (AssertEventListener listener)—registers anAssertEventListener to receive an event when any state change occurs andhas stabilized.

void addTriggerListener (TriggerEventListener listener)—registers aTriggerEventListener to receive a stateless event when a pin has changedstates and stabilized.

int getDebounceTime ( )—returns the time a button must be stable beforeevents will be generated.

int getPinID ( )—returns current Pin ID that identifies which processorbit is used.

int getTriggerReportPolicy ( )—returns the condition for sendingtriggerEvents to report a button press or release.

boolean isPinInverted ( )—each pin can be a positive or negativeassertion logic.

boolean isPressed ( )—returns the current debounced state of the pin.

void removeStateReportListener (AssertEventListenerlistener)—unregisters an assertEventListener so it will no longerreceive an event when a pin state change occurs.

void removeTriggerListener (TriggerEventListener listener)—unregisters atriggerEventListener so it will no longer receive an event when a pinstate change occurs.

void setDebounceTime (int millis)—sets the time in milliseconds that abutton must be stable before interrupts will be generated.

void setPinID (int pinID)—sets the processor bit that will be controlledby this GpioPin object.

void setPinInverted (boolean value)—each pin can be a positive ornegative assertion logic.

void setTriggerReportPolicy (int value)—sets the condition for sendingtriggerEvents to report a button Press or release. It will not affectassertEvents which will always be sent regardless of thetriggerReportPolicy.

void triggerEvent ( )—internal use only method to receive events fromthe underlying GpioPin.

Methods inherited from class java.Iang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Field Detail Related to the PushButton Class for TRIGGER_OFF: publicstatic final int TRIGGER_OFF. Causes the pushButton to no longergenerate any trigger events.

Field Detail Related to the PushButton Class for TRIGGER_ON_PUSH: publicstatic final int TRIGGER_ON_PUSH. Causes the pushButton to send atrigger event only when the button is pushed.

Field Detail Related to the PushButton Class for TRIGGER_ON_RELEASE:public static final int TRIGGER_ON_RELEASE. Causes the pushButton tosend a trigger event only when the button is released.

Field Detail Related to the PushButton Class forTRIGGER_ON_PUSH_AND_RELEASE: public static final intTRIGGER_ON_PUSH_AND_RELEASE. Causes the pushButton to send a triggerevent when the button is pressed or when it is released.

Constructor Detail Related to the PushButton Class for PushButton:public PushButton ( ). Creates an instance of a PushButton that hascontrol over one GpioPin on the microcontroller. The pin ID propertymust be set at a later time before the PushButton can be used.

Constructor Detail Related to the PushButton Class for PushButton:public PushButton (int pinID). Creates an instance of an object thatcontrols one IO pin of the microcontroller. Possible GPIO pinidentifiers include GpioPin.GPIOA_BITX where 0<=X<=7; GpioPin.GPIOB_BITXwhere 0<=X<=7; GpioPin.GPIOC_BITX where 0<=X<=7; GpioPin.GPIOD_BITXwhere 0<=X<=7; and GpioPin.GPIOE_BITX where 0<=X<=7. Parameters:pinID—the pin identifier.

Method Detail Related to the PushButton Class for getPinID: public intgetPinID ( ). Returns current Pin ID that identifies whichmicrocontroller bit is used.

Method Detail Related to the PushButton Class for setPinID: public voidsetPinID (int pinID). Sets the microcontroller bit that will becontrolled by this GpioPin object

Method Detail Related to the PushButton Class for isPressed: publicboolean isPressed ( ). Returns the current debounced state of the pin.This does not reflect the state of the pin, but rather the state afterdebouncing. Returns: true if the pin is pushed, false if the pin is notpushed.

Method Detail Related to the PushButton Class for isPinInverted: publicboolean isPinInverted ( ). Each pin can be a positive or negativeassertion logic. A non-inverted pin will be pushed when the pin isgrounded. An inverted pin will be released when the pin is grounded.Returns: true if the pin is inverting it's logic level.

Method Detail Related to the PushButton Class for setPinInverted: publicvoid setPinInverted (boolean value). Each pin can be a positive ornegative assertion logic. An inverted pin will return false for thestate on a high level and true for a low level. Note: this propertyaffects the PinState property. It does not affect the Report Policy usedto determine when the event is thrown. Parameters: value—true if the pinis inverting its logic level.

Method Detail Related to the PushButton Class for getDebounceTime:public int getDebounceTime ( ). Returns the time a button must be stablebefore events will be generated.

Method Detail Related to the PushButton Class for setDebounceTime:public void setDebounceTime (int millis). Sets the time in millisecondsthat a button must be stable before interrupts will be generated. Thistime period will be used to debounce the switch.

Method Detail Related to the PushButton Class forgetTriggerReportPolicy: public int getTriggerReportPolicy ( ). Returnsthe condition for sending triggerEvents to report a button Press orrelease. An event can be generated based on pin state changes. TheReportPolicy determines when the event is generated. User code can signup to receive the event by the addReportListener( ) registration method.This will affect trigger events, it will not affect assert events. Thefollowing report policies can be returned: PushButton.TRIGGER_OFF,PushButton.TRIGGER_ON_PUSH, PushButton.TRIGGER_ON_RELEASE,PushButton.TRIGGER_ON_PUSH_AND_RELEASE. Returns: the report policycurrently in place for trigger events.

Method Detail Related to the PushButton Class forsetTriggerReportPolicy: public void setTriggerReportPolicy (int value).Sets the condition for sending triggerEvents to report a button Press orrelease. It will not affect assertEvents which will always be sentregardless of the triggerReportPolicy. An event can be generated basedon pin state changes. The ReportPolicy determines when the event isgenerated. User code can sign up to receive the event by theaddReportListener( ) registration method. This will affect triggerevents, it will not affect assert events. The following report policiescan be returned: PushButton.TRIGGER_OFF, PushButton.TRIGGER_ON_PUSH,PushButton.TRIGGER_ON_RELEASE, andPushButton.TRIGGER_ON_PUSH_AND_RELEASE. Parameters: value—the conditionto generate trigger events.

Method Detail Related to the PushButton Class for addTriggerListener:public void addTriggerListener (TriggerEventListener listener).Registers a TriggerEventListener to receive a stateless event when a pinhas changed states and stabilized. Events will be generated accordingthe TriggerReportPolicy currently in place. Parameters: listener—thereceiver of the TriggerEvent.

Method Detail Related to the PushButton Class for removeTriggerListener:public void removeTriggerListener (TriggerEventListener listener).Unregisters a triggerEventListener so it will no longer receive an eventwhen a pin state change occurs. Parameters: listener—the listener thatwill no longer receive events.

Method Detail Related to the PushButton Class for addStateListener:public void addStateListener (AssertEventListener listener). Registersan AssertEventListener to receive an event when any state change occursand has stabilized. Parameters: listener—the receiver of theAssertEvent.

Method Detail Related to the PushButton Class forremoveStateReportListener: public void removeStateReportListener(AssertEventListener listener). Unregisters an assertEventListener so itwill no longer receive an event when a pin state change occurs.Parameters: listener—the listener that will no longer receive events.

Method Detail Related to the PushButton Class for triggerEvent: publicvoid triggerEvent ( ). Internal use only method to receive events fromthe underlying GpioPin. Specified by: triggerEvent in interfaceTriggerEventListener.

The following describes the aRTEC Switch component (public class Switch;extends java.lang.Object; implements AssertEventListener,TriggerEventListener), a component that receives trigger events andrelays them on to one of two trigger listeners. The listener to receivethe trigger event is determined by the state of the switch. The state ofthe switch can be set through properties or by receiving an Assertevent. The switch state is ether true or false.

Constructor Summary Related to the Switch Class: Switch ( ).

Method Summary Related to the Switch Class:

void addFalseListener (TriggerEventListener listener)—registers aTriggerEventListener to be notified when an input trigger is receivedand the switch is in the false state.

void addTrueListener (TriggerEventListener listener)—registers aTriggerEventListener to be notified when an input trigger is receivedand the switch is in the true state

void assertEvent (boolean value)—receives an Assert event that will setthe switch state.

boolean getState ( )—returns the switch state.

void removeFalseListener (TriggerEventListener listener)—unregisters atriggerEventListener so it will no longer receive an event.

void removeTrueListener (TriggerEventListener listener)—unregisters atriggerEventListener so it will no longer receive an event.

void setState (boolean value)—explicitly sets the switch state.

void triggerEvent ( )—receives a trigger event that will be relayed onto one of two trigger event listeners based on the switch state.

Methods inherited from class java.Iang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Constructor Detail Related to the Switch Class: public Switch ( ).

Method Detail Related to the Switch Class for getState: public booleangetStateo. Returns the switch state.

Method Detail Related to the Switch Class for setState: public voidsetState (boolean value). Explicitly sets the switch state

Method Detail Related to the Switch Class for assertEvent: public voidassertEvent (boolean value). Receives an Assert event that will set theswitch state Specified by: assertEvent in interface AssertEventListener.Parameters: active—whether the mode is asserted or non-asserted.

Method Detail Related to the Switch Class for triggerEvent: public voidtriggerEvent ( ). Receives a trigger event that will be relayed on toone of two trigger event listeners based on the switch state. Specifiedby: triggerEvent in interface TriggerEventListener.

Method Detail Related to the Switch Class for addTrueListener: publicvoid addTrueListener (TriggerEventListener listener). Registers aTriggerEventListener to be notified when an input trigger is receivedand the switch is in the true state. Parameters: listener—the receiverof the triggerEvent.

Method Detail Related to the Switch Class for removeTrueListener: publicvoid removeTrueListener (TriggerEventListener listener). Unregisters atriggerEventListener so it will no longer receive an event. Parameters:listener—the listener that will no longer receive events.

Method Detail Related to the Switch Class for addFalseListener: publicvoid addFalseListener (TriggerEventListener listener). Registers aTriggerEventListener to be notified when an input trigger is receivedand the switch is in the false state. Parameters: listener—the receiverof the triggerEvent.

Method Detail Related to the Switch Class for removeFalseListener:public void removeFalseListener (TriggerEventListener listener).Unregisters a triggerEventListener so it will no longer receive anevent. Parameters: listener—the listener that will no longer receiveevents.

The following describes the aRTEC TriggerData component (public classTriggerData; extends java.lang.Object; implements TriggerEventListener),a component that sends a data event with a preset value whenever atrigger event is received.

Constructor Summary Related to the TriggerData Class: TriggerData ( ).

Method Summary Related to the TriggerData Class:

void addDataListener (DataEventListener listener)—registers aDataEventListener to be notified when a trigger event is received.

int getDataValue ( )—returns the value that will be passed in the dataevent.

void removeDataListener (DataEventListener listener)—unregisters aDataEventListener so it will no longer receive events.

void setDataValue (int value)—sets the value that will be passed in thedata event.

void triggerEvent ( )—sends a data event with the preset value.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Constructor Detail Related to the TriggerData Class: public TriggerData( ).

Method Detail Related to the TriggerData Class for getDataValue: publicint getDataValue ( ). Returns the value that will be passed in the dataevent.

Method Detail Related to the TriggerData Class for setDataValue: publicvoid setDataValue (int value). Sets the value that will be passed in thedata event.

Method Detail Related to the TriggerData Class for triggerEvent: publicvoid triggerEvent ( ). Sends a data event with the preset value.Specified by: triggerEvent in interface TriggerEventListener.

Method Detail Related to the TriggerData Class for addDataListener:public void addDataListener (DataEventListener listener). Registers aDataEventListener to be notified when a trigger event is received. ThedataValue property will be passed as the parameter to the event.Parameters: listener—the receiver of the DataEvent.

Method Detail Related to the TriggerData Class for removeDataListener:public void removeDataListener (DataEventListener listener). Unregistersa DataEventListener so it will no longer receive events. Parameters:listener—the listener that will no longer receive events.

The following describes the aRTEC TriggerToAssert component(public classTriggerToAssert; extends java.lang.Object; implementsTriggerEventListener), a component that converts two Trigger inputevents to one Assert output event. An assertEvent is fired whenever atrigger input event is received. True is passed when the positivetrigger event is received and false is passed when the negative triggerevent is received. The class itself implements the positive triggerlistener. You must call getNegativeTriggerListener to get a listener fortrigger events that will send negative assert events.

Constructor Summary Related to the TriggerToAssert Class:TriggerToAssert ( ).

Method Summary Related to the TriggerToAssert Class:

void addAssertListener (AssertEventListener listener)—registers anAssertEventListener to be notified when a trigger event is received.

TriggerEventListener getNegativeTriggerListener ( )—returns aTriggerEventListener that will send an assert event with a false value.

void removeAssertListener (AssertEventListener listener)—unregisters anAssertEventListener so it will no longer receive events.

void triggerEvent ( )—sends an assert event with a true value.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Constructor Detail Related to the TriggerToAssert Class: publicTriggerToAssert ( ).

Method Detail Related to the TriggerToAssert Class for triggerEvent:public void triggerEvent ( ). Sends an assert event with a true value.Specified by: triggerEvent in interface TriggerEventListener.

Method Detail Related to the TriggerToAssert Class forgetNegativeTriggerListener: public TriggerEventListenergetNegativeTriggerListener( ). Returns a TriggerEventListener that willsend an assert event with a false value.

Method Detail Related to the TriggerToAssert Class foraddAssertListener: public void addAssertListener (AssertEventListenerlistener). Registers an AssertEventListener to be notified when atrigger event is received. Parameters: listener—the receiver of theassertEvent.

Method Detail Related to the TriggerToAssert Class forremoveAssertListener: public void removeAssertListener(AssertEventListener listener). Unregisters an AssertEventListener so itwill no longer receive events. Parameters: listener—the listener thatwill no longer receive events.

An event-generating software component 100 can send an event in aunicast or a multicast manner. In a unicast transmission, theevent-generating software component 100 sends an event to a singlelistener software component 102. In a multicast transmission, theevent-generating software component 100 can send the same event to morethan one listener software components. Events that are sent in amulticast manner are referred to as multicast events.

In the JavaBean Component Architecture, listener software componentsregister to receive a particular type event or events. A JavaBean can beset up to transmit events in a unicast or in a multicast manner. Toimplement multicast events, JavaBeans store a vector of the registeredlisteners. When the related event occurs, the vector is traversed andthe multicast event is sent to each of the registered listeners.

It is possible, however, to implement an event multicaster object (ormulticaster) instead of a vector. An event multicaster object is anevent listener that relays the event to two additional listeners. If oneof the additional listeners is also an event multicaster object, theevent is relayed to two more listeners. In this manner any number oflisteners can be registered without the use of a vector. The use of theevent multicaster objects is hidden behind the event registrationmethods.

Use of the event multicaster objects instead of a vector providesbenefits when in a time-sensitive environment. When a single listener isregistered and an event is sent, the event can be sent by a singleinterface call without the looping and overhead associated with thevector approach. As more listeners are registered for the same event,however, the event will be routed through multiple multicasters therebycreating additional overhead. It will be rare, however, to have asituation where enough listeners are registered to create more overheadthan would be created by traversing a vector.

Further, the event multicaster objects can be reusable. Implementingreusable event multicaster objects eliminates the overhead that would beassociated with the creation of new multicasters. Pre-existing eventmulticaster objects are simply put into service as needed when newlistener software components are registered (added). When a listenersoftware component or components are to be removed, the appropriatemulticaster(s) are taken out of service and are again available forreuse when a listener is added. Further, in one embodiment, listenersoftware components are added only at the end of the tree structure.FIGS. 2 through 5 depict features related to the functioning andstructure of the multicast system of the present invention.

FIG. 2 depicts a transmission environment including an event-generatingsoftware component 200, a single listener software component 202 and aplurality of unused event multicaster objects, three of which (204, 206,208) are specifically depicted. The listener software component 202includes code 210 to be executed upon receiving an event notification ofan event for which it has registered. In the structure of FIG. 2, anevent multicaster object 204, 206, 208 is not needed and theyconsequently remain unused.

FIG. 3 depicts a multicast transmission environment involving anevent-generating software component 300, an event multicaster object 302and two listener software components 304, 306, and a plurality of unusedevent multicaster objects 308, 310, 312. (The unused Event MulticasterObjects are not specifically depicted in FIGS. 1, 4 and 5, but they canbe used and included in the same manner in those figures.) Since thereare now two listener software objects 304, 306 an event multicasterobject 302 is required. The event multicaster object 302 includes afirst storage location 314 referencing one of the event listenercomponents 304 and a second storage location 316 referencing the otherevent listener component 306. In one embodiment, the first listenersoftware component to register (for example the listener softwarecomponent 202, FIG. 2) is the listener software component 304 referencedby the first storage location 314 and the next listener softwarecomponent to register is the listener software component referenced bythe second storage location 316. Each of the listener softwarecomponents 304, 306 includes code 318, 320 to be executed upon receivingan event notification of an event for which it has registered.

FIG. 4 depicts a multicast transmission environment involving anevent-generating software component 400, two event multicaster objects402, 404 and three listener software components 406, 408, 410. Anadditional event multicaster object 404 is needed to reference the thirdlistener software component 410. As with the first event multicasterobject 402, FIG. 4; 302, FIG. 3, the second event multicaster object 402includes a first storage location 412 referencing the first eventmulticaster object 402 and a second storage location 414 referencing thethird event listener component 410. Each of the listener softwarecomponents 406, 408, 410 includes code 416, 418, 420 to be executed uponreceiving an event notification of an event for which it has registered.Again, in one embodiment, the first listener software component toregister is listener software component 406, the second to registertakes the position of listener software component 408 and the third toregister is listener software component 410.

It will be appreciated that the structure expanded from FIGS. 2 through4 can be expanded in a similar fashion so as to include any number oflistener software components. FIG. 5 depicts a multicast transmissionenvironment involving an event-generating software component 500, aplurality of event multicaster objects 502, 504 and a plurality oflistener software components, three of which (506, 508, 510) arespecifically depicted. As indicated above, each event multicasterobject, with the exception of the first event multicaster object 502,will reference one listener software component and one event multicasterobject. Each listener software component can include code 512, 514, 516to be executed upon receiving an event notification of an event forwhich it has registered.

The various listener software components can be added to the structureaccording to the order in which they are registered. Further, ifdesired, when a listener software component is to be removed from thestructure, the structure can be reconstituted. Alternatively, removal ofa listener software component can be accomplished by simply deleting thereference to it in the event multicaster object with which it isrelated. Finally, in one embodiment, when an event is communicatedthrough any of the structures of FIGS. 3 through 5, it can be sent firstto the first registered listener software component (for example thelistener software component 506, FIG. 5) and then to the next registeredlistener software component (for example the listener software component508, FIG. 5) and so forth to each of the other listener softwarecomponents in the order in which they were registered as listeners.

Additional detail and description related to specific aRTEC multicastclasses will now be presented.

The following provides a description of the AssertEventMulticaster class(public class AssertEventMulticaster; extends java.lang.Object;implements AssertEventListener): Class AssertEventMulticaster is anevent multicaster for the event AssertEvent. Each instance branches totwo listeners. Includes static helper routines for adding and removinglisteners to the event throwing class.

Method Summary: 1) static AssertEventListener add (AssertEventListenernode, AssertEventListener listener). Helper routine for anyaddAssertEventListener routine. 2) void assertEvent (Boolean active).The event listener. 3) static AssertEventListener remove(AssertEventListener node, AssertEventListener listener). Helper routinefor any removeAssertEventListener routine.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Method Detail: 1) public static AssertEventListener add(AssertEventListener node, AssertEventListener listener). Helper routinefor any addAssertEventListener routine. Adds multicaster nodes asnecessary to support “n” event listeners. The class throwing theAssertEvent should have one reference to a listener and treat it like aunicast event. The add and remove methods should be used to maintain atransparent tree of multicasters to support multiple listeners.Parameters: node—the current value of the topmost event listener;listener—the new single event listener to add to the tree. Returns: thereplacement node for the topmost event listener.

2) public static AssertEventListener remove (AssertEventListener node,AssertEventListener listener). Helper routine for anyremoveAssertEventListener routine. Removes multicaster nodes asnecessary to support “n-1” event listeners. The class throwing theAssertEvent should have one reference to a listener and treat it like aunicast event. The add and remove methods should be used to maintain atransparent tree of multicasters to support multiple listeners.Parameters: node—the current value of the topmost event listener;listener—to remove from the multicast tree. Returns: the replacementnode for the topmost event listener.

3) public void assertEvent (boolean active). The event listener. Relaysthe passed event to two children listeners. Specified by: assertEvent ininterface AssertEventListener. Parameters: source—the mode or state thatis changing; active—if the mode is becoming active or inactive.

The following provides a description of the DataEventMulticaster class(public class DataEventMulticaster; extends java.lang.Object; implementsDataEventListener): Class DataEventMulticaster is an event multicasterfor the event DataEvent. Each instance branches to two listeners.Includes static helper routines for adding and removing listeners to theevent throwing class.

Method Summary: 1) static DataEventListener add (DataEventListener node,DataEventListener listener). Helper routine for any addDataEventListenerroutine. 2) void dataEvent (int value). The event listener. 3) staticDataEventListener remove (DataEventListener node, DataEventListenerlistener). Helper routine for any removeDataEventListener routine.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Method Detail: 1) public static DataEventListener add (DataEventListenernode, DataEventListener listener). Helper routine for anyaddDataEventListener routine. Adds multicaster nodes as necessary tosupport “n” event listeners. The class throwing the DataEvent shouldhave one reference to a listener and treat it like a unicast event. Theadd and remove methods should be used to maintain a transparent tree ofmulticasters to support multiple listeners. Parameters: node—the currentvalue of the topmost event listener; listener—the new single eventlistener to add to the tree. Returns: the replacement node for thetopmost event listener.

2) public static DataEventListener remove (DataEventListener node,DataEventListener listener). Helper routine for anyremoveDataEventListener routine. Removes multicaster nodes as necessaryto support “n-1” listeners. The class throwing the DataEvent should haveone reference to a listener and treat it like a unicast event. The addand remove methods should be used to maintain a transparent tree ofmulticasters to support multiple listeners. Parameters: node—the currentvalue of the topmost event listener; listener—to remove from themulticast tree. Returns: the replacement node for the topmost eventlistener.

3) public void dataEvent (int value). The event listener. Relays thepassed event to two children listeners. Specified by: dataEvent ininterface DataEventListener. Parameters: source—the mode or state thatis changing; active—if the mode is becoming active or inactive.

The following provides a description of the DoubleLongEventlulticasterclass (public class DoubleLongEventMulticaster; extendsjava.lang.Object; implements DoubleLongEventListener): ClassDoubleLongEventMulticaster is an event multicaster for the eventDoubleLongEvent. Each instance branches to two listeners. Includesstatic helper routines for adding and removing listeners to the eventthrowing class.

Method Summary: 1) static DoubleLongEventListener add(DoubleLongEventListener node, DoubleLongEventListener listener). Helperroutine for any addDoubleLongEventListener routine. 2) voiddoubleLongEvent (double doublevalue, long longvalue). The eventlistener. 3) static DoubleLongEventListener remove(DoubleLongEventListener node, DoubleLongEventListener listener). Helperroutine for any removeDoubleLongEventListener routine.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Method Detail: 1) public static DoubleLongEventListener add(DoubleLongEventListener node, DoubleLongEventListener listener). Helperroutine for any addDoubleLongEventListener routine. Adds multicasternodes as necessary to support “n” event listeners. The class throwingthe DoubleLongEvent should have one reference to a listener and treat itlike a unicast event. The add and remove methods should be used tomaintain a transparent tree of multicasters to support multiplelisteners. Parameters: node—the current value of the topmost eventlistener; listener—the new single event listener to add to the tree.Returns: the replacement node for the topmost event listener.

2) public static DoubleLongEventListener remove (DoubleLongEventListenernode, DoubleLongEventListener listener). Helper routine for anyremoveDoubleLongEventListener routine. Removes multicaster nodes asnecessary to support “n-1” event listeners. The class throwing theDoubleLongEvent should have one reference to a listener and treat itlike a unicast event. The add and remove methods should be used tomaintain a transparent tree of multicasters to support multiplelisteners. Parameters: node—the current value of the topmost eventlistener; listener—to remove from the multicast tree. Returns: thereplacement node for the topmost event listener.

3) public void doubleLongEvent (double doublevalue, long longvalue). Theevent listener. Relays the passed event to two children listeners.Specified by: doubleLongEvent in interface DoubleLongEventListener.Parameters: source—the mode or state that is changing, active—if themode is becoming active or inactive.

The following provides a description of the DoubleEventMulticaster class(public class DoubleEventMulticaster; extends java.lang.Object;implements DoubleEventListener): Class DoubleEventMulticaster is anevent multicaster for the event DoubleEvent. Each instance branches totwo listeners. Includes static helper routines for adding and removinglisteners to the event throwing class.

Method Summary: 1) static DoubleEventListener add (DoubleEventListenernode, DoubleEventListener listener). Helper routine for anyaddDoubleEventListener routine. 2) void doubleEvent (double value). Theevent listener. 3) static DoubleEventListener remove(DoubleEventListener node, DoubleEventListener listener). Helper routinefor any removeDoubleEventListener routine.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Method Detail: 1) public static DoubleEventListener add(DoubleEventListener node, DoubleEventListener listener). Helper routinefor any addDoubleEventListener routine. Adds multicaster nodes asnecessary to support “n” event listeners. The class throwing theDoubleEvent should have one reference to a listener and treat it like aunicast event. The add and remove methods should be used to maintain atransparent tree of multicasters to support multiple listeners.Parameters: node—the current value of the topmost event listener;listener—the new single event listener to add to the tree. Returns: thereplacement node for the topmost event listener.

2) public static DoubleEventListener remove (DoubleEventListener node,DoubleEventListener listener). Helper routine for anyremoveDoubleEventListener routine. Removes multicaster nodes asnecessary to support “n-1” event listeners. The class throwing theDoubleEvent should have one reference to a listener and treat it like aunicast event. The add and remove methods should be used to maintain atransparent tree of multicasters to support multiple listeners.Parameters: node—the current value of the topmost event listener;listener—to remove from the multicast tree. Returns: the replacementnode for the topmost event listener.

3) public void doubleEvent (double value). The event listener. Relaysthe passed event to two children listeners. Specified by: doubleEvent ininterface DoubleEventListener. Parameters: source—the mode or state thatis changing, active—if the mode is becoming active or inactive.

The following provides a description of the FloatEventMulticaster class(public class FloatEventMulticaster; extends java.lang.Object;implements FloatEventListener). Class FloatEventMulticaster is an eventmulticaster for the event FloatEvent. Each instance branches to twolisteners. Includes static helper routines for adding and removinglisteners to the event throwing class.

Method Summary: 1) static FloatEventListener add (FloatEventListenernode, FloatEventListener listener). Helper routine for anyaddFloatEventListener routine. 2) void floatEvent (float value). Theevent listener. 3) static FloatEventListener remove (FloatEventListenernode, FloatEventListener listener). Helper routine for anyremoveFloatEventListener routine.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Method Detail: 1) public static FloatEventListener add(FloatEventListener node, FloatEventListener listener). Helper routinefor any addFloatEventListener routine. Adds multicaster nodes asnecessary to support “n” event listeners. The class throwing theFloatEvent should have one reference to a listener and treat it like aunicast event. The add and remove methods should be used to maintain atransparent tree of multicasters to support multiple listeners.Parameters: node—the current value of the topmost event listener;listener—the new single event listener to add to the tree. Returns: thereplacement node for the topmost event listener.

2) public static FloatEventListener remove (FloatEventListener node,FloatEventListener listener). Helper routine for anyremoveFloatEventListener routine. Removes multicaster nodes as necessaryto support “n-1” event listeners. The class throwing the FloatEventshould have one reference to a listener and treat it like a unicastevent. The add and remove methods should be used to maintain atransparent tree of multicasters to support multiple listeners.Parameters: node—the current value of the topmost event listener;listener—to remove from the multicast tree. Returns: the replacementnode for the topmost event listener.

3) public void floatEvent (float value). The event listener. Relays thepassed event to two children listeners. Specified by: floatEvent ininterface FloatEventListener. Parameters: source—the mode or state thatis changing; active—if the mode is becoming active or inactive.

The following provides a description of the LongEventMulticaster class(public class LongEventMulticaster; extends java.lang.Object; implementsLongEventListener. Class LongEventMulticaster is an event multicasterfor the event LongEvent. Each instance branches to two listeners.Includes static helper routines for adding and removing listeners to theevent throwing class.

Method Summary: 1) static LongEventListener add (LongEventListener node,LongEventListener listener). Helper routine for any addLongEventListenerroutine. 2) void longEvent (long value). The event listener. 3) staticLongEventListener remove (LongEventListener node, LongEventListenerlistener). Helper routine for any removeLongEventListener routine.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Method Detail: 1) public static LongEventListener add (LongEventListenernode, LongEventListener listener). Helper routine for anyaddLongEventListener routine. Adds multicaster nodes as necessary tosupport “n” event listeners. The class throwing the LongEvent shouldhave one reference to a listener and treat it like a unicast event. Theadd and remove methods should be used to maintain a transparent tree ofmulticasters to support multiple listeners. Parameters: node—the currentvalue of the topmost event listener; listener—the new single eventlistener to add to the tree. Returns: the replacement node for thetopmost event listener.

2) public static LongEventListener remove (LongEventListener node,LongEventListener listener). Helper routine for anyremoveLongEventListener routine. Removes multicaster nodes as necessaryto support “n-1” event listeners. The class throwing the LongEventshould have one reference to a listener and treat it like a unicastevent. The add and remove methods should be used to maintain atransparent tree of multicasters to support multiple listeners.Parameters: node—the current value of the topmost event listener;listener—to remove from the multicast tree. Returns: the replacementnode for the topmost event listener.

3) public void longEvent (long value). The event listener. Relays thepassed event to two children listeners. Specified by: longEvent ininterface LongEventListener. Parameters: source—the mode or state thatis changing; active—if the mode is becoming active or inactive.

The following provides a description of the StringEventMulticaster class(public class StringEventMulticaster; extends java.lang.Object;implements StringEventListener): Class StringEventMulticaster is anevent multicaster for the event StringEvent. Each instance branches totwo listeners. Includes static helper routines for adding and removinglisteners to the event throwing class.

Method Summary: 1) static StringEventListener add (StringEventListenernode, StringEventListener listener). Helper routine for anyaddStringEventListener routine. 2) static StringEventListener remove(StringEventListener node, StringEventListener listener). Helper routinefor any removeStringEventListener routine. 3) void stringevent(java.lang.String value). The event listener.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Method Detail: 1) public static StringEventListener add(StringEventListener node, StringEventListener listener). Helper routinefor any addStringEventListener routine. Adds multicaster nodes asnecessary to support “n” event listeners. The class throwing theStringEvent should have one reference to a listener and treat it like aunicast event. The add and remove methods should be used to maintain atransparent tree of multicasters to support multiple listeners.Parameters: node—the current value of the topmost event listener;listener—the new single event listener to add to the tree. Returns: thereplacement node for the topmost event listener.

2) public static StringEventListener remove (StringEventListener node,StringEventListener listener). Helper routine for anyremoveStringEventListener routine. Removes multicaster nodes asnecessary to support “n-1” event listeners. The class throwing theStringEvent should have one reference to a listener and treat it like aunicast event. The add and remove methods should be used to maintain atransparent tree of multicasters to support multiple listeners.Parameters: node—the current value of the topmost event listener;listener—to remove from the multicast tree. Returns: the replacementnode for the topmost event listener.

3) public void stringEvent (java.lang.String value). The event listener.Relays the passed event to two children listeners. Specified by:stringEvent in interface StringEventListener. Parameters: source—themode or state that is changing; active—if the mode is becoming active orinactive.

The following provides a description of the TriggerEventMulticasterclass (public class TriggerEventMulticaster; extends java.lang.Object;implements TriggerEventListener): Class TriggerEventMulticaster is anevent multicaster for the event TriggerEvent. Each instance branches totwo listeners. Includes static helper routines for adding and removinglisteners to the event throwing class.

Method Summary: 1) static TriggerEventListener add (TriggerEventListenernode, TriggerEventListener listener). Helper routine for anyaddTriggerEventListener routine. 2) static TriggerEventListener remove(TriggerEventListener node, TriggerEventListener listener). Helperroutine for any removeTriggerEventListener routine. 3) void triggerEvent( ). The event listener.

Methods inherited from class java.lang.Object: equals, getClass,hashCode, notify, notifyAll, toString, wait.

Method Detail: 1) public static TriggerEventListener add(TriggerEventListener node, TriggerEventListener listener). Helperroutine for any addTriggerEventListener routine. Adds multicaster nodesas necessary to support “n” event listeners. The class throwing theTriggerEvent should have one reference to a listener and treat it like aunicast event. The add and remove methods should be used to maintain atransparent tree of multicasters to support multiple listeners.Parameters: node—the current value of the topmost event listener;listener—the new single event listener to add to the tree. Returns: thereplacement node for the topmost event listener.

2) public static TriggerEventListener remove (TriggerEventListener node,TriggerEventListener listener). Helper routine for anyremoveTriggerEventListener routine. Removes multicaster nodes asnecessary to support “n-1” event listeners. The class throwing theTriggerEvent should have one reference to a listener and treat it like aunicast event. The add and remove methods should be used to maintain atransparent tree of multicasters to support multiple listeners.Parameters: node—the current value of the topmost event listener;listener—to remove from the multicast tree. Returns: the replacementnode for the topmost event listener.

3) public void triggerEvent ( ). The event listener. Relays the passedevent to two children listeners. Specified by: triggerEvent in interfaceTriggerEventListener. Parameters: source—the mode or state that ischanging; active—if the mode is becoming active or inactive.

In the ARTEC model, each of the EventMulticaster classes maintains alist of the EventListeners registered to receive notification of theoccurrence of the particular event. As new EventListeners are added, thenew elements appear on the appropriate EventMulticaster list. AsEventListeners are removed, the event multicaster objects are added to alisting of free nodes so as to avoid garbage collection generation.Subsequent listener additions will reuse any event multicaster objectsthat have been made available as a result of previous removals. Toinvoke any of the multicast events, the appropriate EventMulticastercalls the appropriate Event( ) methods of the related EventListenersstarting with the first listener software component added and proceedingin order to the last listener software component registered. Acommunication of an event with only a single registered event listenercomponent is actually implemented as a multicast that has just a singlelistener on the multicast list.

FIG. 6 depicts an architecture for interfacing a hardware device andclient software, the architecture including a hardware device 600, aninterrupt controller component 602 and a hardware event object 604.Starting with the hardware end of the architecture, the hardwarecomponent 600 can be any of a wide variety of such components. Forexample, the hardware device 600 can be a button, key, or any other suchinput or signaling device. It can also be a pin of an interface. Forexample, it can be a pin of a General Purpose digital Input/Output(GPIO) port. A change in state of the hardware device, for example, willcause a signal to be output from the hardware device 600.

The signal from the hardware device 600 is passed to the interruptcontroller component 602 and the interrupt controller triggers theappropriate interrupt method 605 from its interrupt vector table andcommunicates 606 it to the hardware event object 604. The properties 610of the hardware event object 604 can be set and retrieved via setter 612and getter 614 methods. The properties 610 include PinID, PinState,OutputPin, PinReportPolicy and ReportThread. The hardware event object604 includes a first-in-first-out (FIFO) data structure 616 and adispatch thread 618.

Via the architecture of FIG. 6, the interrupt can eventually precipitatethe sending of a software event to the appropriate user event handlersof the registered listener software components. Since it is often notdesirable to send these events at an interrupt priority level, adispatch thread 618 is included. The dispatch thread 618 can wait forthe state change and then send an event notification to user code at apriority level that is lower than the original interrupt priority level.

Upon receipt by the hardware event object, the interrupt event 606 iscommunicated directly to the dispatch thread 618 to wake it up ifnecessary. The interrupt event 606 is also placed into the FIFO queue616. The dispatch thread 618 then works through and services eachreceived interrupt event 606 in the order in which it was received. Asit services each of the interrupt events received from the FIFO 616, thedispatch thread 618 causes the appropriate software events to begenerated and output 620.

The dispatch thread 618 is a thread that sleeps until some eventrequiring servicing is received. It is awakened by an invocation of itswake method (upon receipt of an interrupt event for example) and it willthen service the tasks until each has been completed. It is usuallydesirable to give the dispatch thread 618 an elevated priority level(for example one higher than any calling thread). Once awakened, thedispatch thread will poll all registered listeners and service them ifrequired.

When, for example, the hardware device 600 is a GPIO pin, a change inpin state will precipitate the generation of an interrupt. An interruptevent 606 will subsequently be forwarded to the hardware event object604. Each pin state change will thus by forwarded to the hardware eventobject 604 and placed into the FIFO 616. The dispatch thread 618 willservice each interrupt event by forwarding it as a software event toeach of the event's registered listeners. In this embodiment, each pinof the port would be associated with a dedicated interrupt method andhardware event object. In one embodiment, the default is to use onedispatch thread for all of the GPIO pins. If, however, differentpriorities are required for different pins, a new dispatch thread can beassigned to each pin.

If desired, the architecture of FIG. 6 can be used with the modeldisclosed in relation to FIG. 1 or as disclosed in FIGS. 1 though 5. Insuch a case, the software event output 620 from the hardware eventobject 604 can be a cracked event. Further, the outputted cracked event,if desired, can then be multicasted in the manner disclosed in FIGS. 2through 5.

It is thought that the method and apparatus of the present inventionwill be understood from the description provided throughout thisspecification, including the drawings and the appended claims, and thatit will be apparent that various changes may be made in the form,construct steps and arrangement of the parts and steps thereof, withoutdeparting from the spirit and scope of the invention or sacrificing allof their material advantages. The forms herein described are merelyrepresentative embodiments thereof. For example, although someembodiments of the invention have been described in relation to theJavaBeans Component Architecture and the JAVA programming language, thepresent inventions are capable of being used with other types ofcomponent architectures and programming languages that have been, orwill be, developed.

1. An apparatus for associating a hardware interrupt event with asoftware component event, comprising: a hardware interrupt signal inputinterface; a first-in-first-out data structure coupled with saidhardware interrupt signal input interface and comprising afirst-in-first-out output interface; and a dispatch thread componentcomprising, an event input coupled with said first-in-first-out output,and a dispatch thread output interface, said dispatch thread componentcreating a software event to be output via said dispatch thread outputinterface.
 2. The apparatus of claim 1, wherein said dispatch threadcomponent further comprises a wake-up input interface coupled with saidhardware interrupt signal input interface.
 3. The apparatus of claim 2,further comprising an interrupt controller component, said interruptcontroller component comprising a plurality of interrupt methods, saidinterrupt controller component further comprising an interrupt eventsignal output coupled with said hardware interrupt signal inputinterface.
 4. The apparatus of claim 3, further comprising a hardwareinterrupt generating component coupled with said interrupt controllercomponent, and wherein an interrupt method of said plurality ofinterrupt methods is responsive to an interrupt signal generated by saidhardware interrupt generating component.
 5. The apparatus of claim 4,wherein said hardware interrupt generating component comprises aninput/output pin.
 6. The apparatus of claim 5, wherein said input/outputpin is a pin of a General Purpose Input Output interface.
 7. Theapparatus of claim 1, wherein said dispatch thread component furthercomprises at least one associated property, and further comprising aproperty getter interface and a property setter interface each capableof accessing said at least one associated property.
 8. The apparatus ofclaim 4, further comprising: a first listener software component,comprising first code to receive a software event generated by saiddispatch thread; and an event transmission object, said eventtransmission object comprising a primitive data type parameter thatconveys data describing an event related to a software event.
 9. Theapparatus of claim 8, further comprising a first event multicasterobject, said first event multicaster object comprising a firstreference, said first reference identifying said first listener softwarecomponent, said first event multicaster object further comprising afirst multicaster object event input interface, wherein said first eventmulticaster object can receive said event transmission object and pass,via said first reference, said event transmission object to said firstlistener software component.
 10. The apparatus of claim 9, furthercomprising a second listener software component comprising second codeto receive a software event generated by said dispatch thread, andwherein said first event multicaster object further comprises a secondreference, said second reference identifying said second listenersoftware component, wherein said first event multicaster object canpass, via said second reference, said event transmission object to saidsecond listener software component.
 11. The apparatus of claim 10,wherein said first listener software component comprises a first eventhandler, wherein said second listener software component comprises asecond event handler and wherein said first event multicaster objectfurther comprises code to call said first event handler and then to callsaid second event handler.
 12. The apparatus of claim 11, furthercomprising a second event multicaster object, said second eventmulticaster object comprising a first reference, said first referenceidentifying said first event multicaster object, said second eventmulticaster object further comprising a second multicaster object eventinput interface, wherein said second event multicaster object canreceive said event transmission object and pass, via said firstreference, said event transmission object to said first eventmulticaster object.
 13. The apparatus of claim 12, further comprising athird listener software component comprising third code to receive asoftware event generated by said dispatch thread, and wherein saidsecond event multicaster object further comprises a second reference,said second reference identifying said third listener softwarecomponent, wherein said second event multicaster object can pass, viasaid second reference, said event transmission object to said thirdlistener software component.
 14. The apparatus of claim 13, wherein saidthird listener software component comprises a third event handler, andwherein said second event multicaster object further comprises code topass said event transmission object to a said first event multicasterobject and to call said third event handler after said second eventhandler has been called by said first event multicaster object.
 15. Theapparatus of claim 9, wherein said hardware event object furthercomprises a listener add method.
 16. The apparatus of claim 10, furthercomprising: a second listener software component, comprising second codeto receive a software event generated by said dispatch thread; one ormore additional listener software components, each comprising code toreceive a software event generated by said dispatch thread; and one ormore event multicaster objects, each said one or more event multicasterobjects comprising a first object reference and a second objectreference; wherein said one or more event multicaster objects, saidsecond listener software component and said one or more additionallistener software components are linked via each of said first objectreferences and each of said second object references such that a systemhaving “n” listener software components will have “n-1” eventmulticaster objects, “n” representing any positive integer greater thanpositive three.
 17. An apparatus for associating a hardware interruptevent with a software component event, comprising: a hardware interruptsignal input interface; means, coupled with said hardware interruptsignal input interface, for storing in a first-in-first-out manner,hardware interrupt signals received via said hardware interrupt signalinput interface; and means, coupled with said means for storing, forretrieving the next signal to be output from said means for storing, andfor then outputting a software event related to the retrieved signal.18. The apparatus of claim 17, further comprising: a first listenersoftware component, comprising first means for receiving a softwareevent output by said means for retrieving; and means for transmitting aprimitive data type parameter from said means for retrieving to saidfirst listener software component, said means for transmitting conveyingdata related to the outputted software event.
 19. The apparatus of claim18, further comprising a first event multicaster object, said firstevent multicaster object comprising a first reference, said firstreference identifying said first listener software component, said firstevent multicaster object further comprising a first multicaster objectevent input interface, wherein said first event multicaster object canreceive said means for transmitting and pass, via said first reference,said means for transmitting to said first means for receiving; andfurther comprising a second listener software component comprisingsecond means for receiving a software event output by said means forretrieving, and wherein said first event multicaster object furthercomprises a second reference, said second reference identifying saidsecond listener software component, wherein said first event multicasterobject can pass, via said second reference, said means for transmittingto said second means for receiving.
 20. The apparatus of claim 18,further comprising: a second listener software component, comprisingsecond means for receiving a software event output by said means forretrieving; one or more additional listener software components, eachcomprising means for receiving a software event output by said means forretrieving; and one or more event multicaster objects, each said one ormore event multicaster objects comprising a first reference and a secondreference; wherein said one or more event multicaster objects, saidsecond listener software component and said one or more additionallistener software components are linked via each of said first objectreferences and each of said second object references such that a systemhaving “n” listener software components will have “n-1” eventmulticaster objects, “n” representing any positive integer greater thanpositive three.